package top.zackyoung.druid.simple.mapper;

import lombok.Data;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author ZackYoung
 * @version 1.0
 * @date 2021/9/28
 */
@Mapper
public interface UserMapper {
    @Select("select * from user ")
    List<User> selectAllUser();

    @Select("select * from user where id = '{id}'")
    List<User> selectByPrimaryKey(@Param("id") Long id);
}

@Data
class User {
    private String username;
}
